import request from '@/utils/request'

export default {
    // 获取标签信息
    getList(query, current = 1, size = 20) {
        return request({
            url: '/article/label/search',
            method: 'post',
            data: {
                ...query,
                current,
                size
            }

        })
    },
    //获取所有正常状态的分类
    getNormalList() {
        return request({
            url: `/article/category/list`,
            method: 'get',
        })
    },

    // 增加新标签
    add(data) {
        return request({
            url: '/article/label',
            method: 'post',
            data: data

        })
    },
    // 更新数据
    update(data) {
        return request({
            url: `/article/label`,
            method: 'put',
            data: data
        })
    },

    // 根据ID删除标签
    deleteById(id) {
        return request({
            url: `/article/label/${id}`,
            method: 'delete',

        })
    },

    // 通过id查询
    getById(id) {
        return request({
            url: `/article/label/${id}`,
            method: 'get',
        })
    },
}